package com.gm.wholesale.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.gm.commonlib.base.baseBean.BaseResp;
import com.gm.commonlib.base.baseView.IBaseView;
import com.gm.commonlib.interfaces.ICallBackListener;
import com.gm.commonlib.network.BaseHttpObserver;
import com.gm.commonlib.views.toast.ToastUtil;
import com.gm.wholesale.R;
import com.gm.wholesale.module.good.bean.GoodListBean;
import com.gm.wholesale.module.good.model.GoodModel;

public class DeleteFunctionView extends LinearLayout {
    private LinearLayout deleteView;
    private Context mContext;

    public DeleteFunctionView(Context context) {
        super(context);
        initView(context);
    }

    public DeleteFunctionView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    private void initView(Context context) {
        mContext = context;
        LayoutInflater.from(context).inflate(R.layout.view_delete_function, this);
        deleteView = findViewById(R.id.deleteView);

    }

    public void showView(OnClickListener iCallBackListener) {
        setVisibility(VISIBLE);
        deleteView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                iCallBackListener.onClick(v);
                hidView();
            }
        });
    }

    public void hidView() {
        setVisibility(GONE);
    }
}
